BRF Resource Management

BRF Files and OpenBRF

BRF stands for Binary Resource File. It is a container format, such as zip. Within the same container developers and modders of M&B usually distribute various reltated assets.[1] BRF files are a file format used by the Mount&Blade game series to hold most game graphical content: meshes, materials, textures, collision boxes, shaders, animations and skeletons for animations.

OpenBRF is a tool to edit and preview the content of those BRF files. You can preview them, import/export them in an array of formats (so that you can edit them in external applications), as well as edit them. This would be useful to build your own game module aka mod.[2] The tool is built over Qt and OpenGL libraries to give easily 3D-support without the need to install anything in your unpolluted Windows/Wine system. The libraries have pre-generated geometry "calls" to common meshes. Those libraries or "callable sub-programs" are the middleman between the hardware (graphic card) and the user software (draw in the OpenBRF 3D-frame).[3] OpenBRF was originally developed for Mount&Blade version 1.011 (also called Vanilla M&B) but is backward compatible with Mount&Blade .808 BRF files (load only) and "forward" compatible with Warband BRF files (save/load).[4]

For the basic usage: To access most functions you must select the object you want to act on (e.g. a mesh), clicking it on the list at the left, and then: either right click on it or use the [Selected] menu option, and then select the command from the menu. You can also select multiple objects, by Shift- / Ctrl-clicking on them. That way you can perform an action on all of them at once (via the context menu, as normal). Many things are also explained in the context menus.[2]

BRF File Format

If you save the BRF file as Warband Resource you have to make sure every mesh has the 'standard' 30000 (or 30001 as used by buildings, it seems) mesh flag, but if you save as M&B Resource it can work with the 0 flag. Many folk have had problems with the Warband Resource .brf type and many people have had problems with the game simply not starting if there have been meshes within these brf files with the 0 flag.[5] If all meshes have either the flag 30000 or 30001 then the Warband resource works as well.[6]

However, the Mount&Blade Engine can use two types of container formats, .brf and .trf files. Latter one stands for Text Resource Files. It's the format which the developers used, at least at the beginning, internally when working with Blender. The game engine can use this format seamlessly and converts them automatically to Binary Resource Files.[7]

TRF and BRF files are being used in the same way. The Mount&Blade Engine will look at the "creation" time of TRF and BRF files. If you have two files with the names X.trf and X.brf, the .trf file will only be used if its creation time is closer to the current time. If you put a .trf file into the resource folders of M&B, it will be converted to a .brf file while the game is getting loaded. And of course you need to add the .trf file's name to the list of loaded resources at your module.ini. Take note that if you have two files with names X.trf and X.brf, the game engine can overwrite X.brf. So backup your BRF files if you need them.[7]

You can create TRF files with the official Blender Exporter. It's the workflow that the Taleworlds Devs used. As the BRF format itself, it has been reversed-engineered by a Spanish guy named Lurb. And after various trials Thorgrim carried on with the editor project and later mtarini released the tool OpenBRF. So the modders have never had any official SDK or anything, only homemade tools. The released Blender plug-in came with five, maybe six years of delay and is since then hardly used.[8]

At the very beginning of Mount & Blade the binary resource format has been called RSF. Armagan did not recommend messing with them "since they are too difficult to work with".[9]

BRF Loading Order

To guarantee that your newly added resources are working correctly there are various loading orders which you need to respect. This means that specific resource files need to be listed above others at the file module.ini. The most important loading order is the upfollowing one:

								
									Shaders & Textures -> Material -> Meshes
								
							

To guarantee that a mesh is showing up properly in-game one must make sure that the material it references is either getting loaded within the same brf file or a brf file listed above it. To guarantee that this material is working correctly one must respectively ensure that the referenced textures and shader are getting loaded within the same brf file or brf files listed above it. Usually the shaders are inside one of the brf files which gets loaded already at some top line.

Two other less known loading order are rarely showing up as a problem because they are important for resources which belong to the least often modded ones: skeletons and animations. It is important that skeletons are getting loaded before animations and before meshes which are rigged to them. There seems to be no required loading order for meshes and animations. And collision meshes aren't affected by any of the above but are generally loaded together with their (scene object) meshes, so keep those together.[10]

OpenBRF [11]

OpenBRF is the cornerstone of Mount&Blade Modding. Made by Marco Tarini (mtarini) with the "The Last Days of the Third Age" module in mind (the Lord of the Ring based one), it was originally developed as an internal tool. Seeing the potential of it, Marco decided to release it publicly as an open source tool, hence the name OpenBRF.

Once its public release was announced in the official forums, it was received with expectation, good critics and a mare magnum of suggestions. Slow but steady Marco began to add features from animation support to vertex coloring, investigating Warband's format with zero documentation from part of the TaleWorlds developers. After a short time OpenBRF has been accepted as the de-facto tool by the Mount&Blade modding scene. It is meant to be used to preview and edit BRF files (Binary Resource Files), i.e. most content of the game (e.g. meshes and animations).

General usability hints:

  • most tools can be applied over multiple objects in one go: just make a multiple selection first
  • most tools are accessed by right-clicking on over selected item(s) in the list, or though the [selected] menu.
  • you can repeat last command with [Ctrl+R], and undo redo with [Ctrl+Z] and [Ctrl+Y]

Basic Features

Loading & Saving
  • Loads and saves all contents of BRF files:
    1. Meshes (including vertex-animated & rigged)
    2. Collision objects (including spheres capsules manifold & faces...)
    3. Textures, Materials, Shaders
    4. Skeletons, Skeletal-animations
  • Compatibility:
    1. M&B ver 1.011 complaint
    2. Back compatibility with M&B .808 BRF files (load only)
    3. "Forward" compatibility with Warband BRF files (save/load)
Viewing
  • Meshes, Collision Objects, Skeletons, Skeletal-animations, Texture, Material and Hitboxes:
    Shown in 3D view (using, as appropriate, textures, wireframe, per-vertex color, animations, customizable skins, alpha channel, xrays - for collision objects, etc.)
  • All attributes for all objects (e.g. flags, numbers and strings) are shown in the GUI
  • Navigation mode (WASD) for interiors; custom view orientation for helmets
  • Different modes for viewing multiple selections: "side-to-side", "combined" and "auto".
Importing & Exporting
  • Meshes exported/imported in: obj (including multi-material), ply, dxf (autocad), dae (collada), off
    (not all formats allow to export vertex colors or normals. Normals are recomputed if missing)
  • Rigged meshes, Skeletal-animations: export/import as SMD (or maya .ma, experimental)
  • Skeletons: export/import as SMD - also, export/import as a control (static) mesh
  • Vertex-animated meshes: export/import as MD3 or as separate frames
  • Collision bodies: export/import as multiple-object obj (notes on usage: see this info integrate https://forums.taleworlds.com/index.php?threads/download-link-and-main-info-latest-ver-0-0-82e-19-jun-2016.72279/page-10#post-1912260 at the section below and reference it)
  • Hitboxes: save/load in/from data.xml file, or as turn into Collision Bodies (notes on usage: see this info integrate https://forums.taleworlds.com/index.php?threads/minitutorial-hit-boxes-manipulation-in-openbrf.214058/#post-5107479 at the section skeletons below and reference it)
Basic Editing
  • Direct editing of any attribute of any object (e.g. flags)
  • Group edits: multiple-select objects to view or edit them all in one go (e.g. renaming a group will edit prefixes)
  • Cut (Ctrl+X), copy (Ctrl+C) and paste (Ctrl+V) objects to easily move them from a brf file to another
  • Remove, rename, duplicate, sort objects; move them up and down in the list. Group rename works also for groups of objects (you change, add, or remove common prefixes). Sort objects alphabetically (command under "Tools")
  • With (Ctrl+R) you repeat the last command!
  • Undo/redo with (Ctrl+Z), (Ctrl+Y)
  • Search for objects or module inconsistencies

Tools for Skeletons/Rigging/Skeletal-Animation

Autobreak-up of animations into sub-sequences (useful for for long sequence of animations listed as a single one). Animation can be either auto-split, by dividing chunks separated by large gaps in frame numeration, or split by following an action.txt file (in this case, a new action.txt is also produced, which refers the new split animations. The original action.txt file is kept intact -- just for safety).
How-to: Just right click on an animation in the list.
Customizable skinning to view animations Rigged meshes can be enlisted to compose "skins". Skins are sets of user-selected rigged meshes which are used by OpenBRF to display skeletal-animations. Similarly, animations can be set as "reference animations" so that you can see your rigged meshes under that animation. Skins can also be used to export animations/rigged meshes/skeletons.
How to:
  1. Right click on the mesh to add it to a skin, or on an animation to use it as a "reference" animation.
  2. Reference objects (skeletons, animations, models) are auto-saved but you can also edit them directly (tools => edit reference models).
Simplified skeleton retouching through meshes This is to allow edits of the skeleton without using an animation program (small thing). First, export a "skeleton modification mesh", which is just a static mesh (e.g. obj) featuring the bones. Then, edit the resulting mesh using any 3D editor; don't change bone size, number or shape: only their orientation and positions. Then, you use that mesh to modify the skeleton, and OpenBRF will modify just bone positions/orientation, keeping all else, like bone names, bone connections etc.
Reskeletonize tool for rigged meshes This can be used to go from a mesh rigged for skeleton A to make a new mesh rigged for skeleton B (if the two skeletons are similar enough). The mesh will deform to adapt to the new skeleton. This is not supposed to be perfect, but can be a start for further editing. Optionally, the deformed mesh can be placed as a frame to the original body mesh (you know, just how Native hides feminine version of armor shapes in subsequent frames).
Transfer rigging from a mesh to another To transfer rigging from a rigged "exemplar" mesh to one or more target (usually non rigged) meshes (similar to "obj2smd" program), select one or more exemplar meshes, copy [ctrl+C], select then one or more target meshes and click on "edit" => "paste rigging".
Transfer timings To transfer timings (times per frame): as above, but use "paste timings".
Copy lower part of an animation To transfer the lower part of an animation (legs and abdomen position) into another animation. Useful for example to turn an animation for standing charter on the counterpart for mounted characters. How to: as above, but use "paste lower part of animation".
Mirror (animations) That's what you'd expect: left half of the body will do what the right half did (but mirrorred).
Mount/unmount things on bones To attach a given item over a bone of a skeleton of choice: it will be moved in position and rigged to that bone. Also, the reverse. Also useful to make skins. Also includes special predefined carry-positions (e.g. scabbards tied on belts or shields carried on back), as used by M&B/WB (but customizable). Inverse functions also available (see under [discard]=>[rigging]).
Freeze skeletal animation frames To make a static "statue" out of a rigged object (in a given position) (see under [discard]=>[rigging]).
Make small sub-pieces of rigged mesh rigid An small autofix tool for rigged objects. Its use is to make small pieces of a rigged mesh, like plates of an armour, move rigidly during skeletal animations, i.e. without deforming. The pieces are identified as connected components of the mesh. How to: right click on the mesh and select corresponding option.
Hitbox manipulation see more info in this [tutorial] work in https://forums.taleworlds.com/index.php?threads/minitutorial-hit-boxes-manipulation-in-openbrf.214058/#post-5107479 at section skeletons below and reference here

Tools for 3D-Meshes

Combine meshes tools [Combine] makes one mesh from many (works with static, vertex-animated, rigged meshes alike). Similarly, you can select and copy (Ctrl+C) one or more meshes, then select one or several target meshes, and use [edit]=>[paste into mesh] to copy the former into the letter, merging them. In this case, LoDs are mantained, meaning that meshes of a given lod will be only merged with target meshes of the same lod.
Split meshes tool Command [Split into connected sub-components] separate selected mesh(es) into one mesh for each topologically separated piece (note: after working on each piece separately, you can assemble them back, see above).
Rescale-rotate-translate, Mirror Just as the name says. Also, in the [roto-translate-tool] there are buttons to center the object around (or above, or below) the zero (in any axis separately). For convenience, you can also roto-translate-scale an object while seeing other reference objects fixed, e.g. to align them accurately to each other.
Vertex optimization tool Merges together positions and vertices, clean redundant, dangling, repeated vertices, and so on, so that the data is more compact and rendering efficient. You can see the number of vertices and positions go down in the "data" box. There is also an option to automatically perform these operations after import ([setting]=>[on import meshes]).
Two vertices will be merged if they are totally identical: same u,v, coords, same normal, and they refer to the same "position" (so they have same XYZ coords and same rigging).
Two positions will be merged if they have the same XYZ coordiantes, and the same rigging.
Redefine hard-edges Hard edges (normal discontinuities) can also be redefined using a custom crease-angle parameter, with the above tool. Texture seams can be preserved or ignored.
Normal computations Recomputes normals, allowing for selectable amount of crease angles (aka hard edges).
Tangent direction computations Tangent directions, which are needed for bumpmapping and some shaders, can be computed (from UV-mapping) over your meshes (they can be saved only as Warband BRF).
LoDs computation OpenBRF can build LoD's (level of details) for your meshes, progressively simplifying them by automatic polygonal reduction. Under "settings", you can customize which LoD are produced, and how much polygonal reduction should take place.
Ruler and "floating probe" measuring tool The first is designed to pinpoint the precise reach of weapons. The second to identify locations over a mesh (results also copied to clipboard, for convenience).
Back-faces Add them (creates x2 faces) or remove them. Useful for flat impostors that must be seen from both sides.
"Feminization" of outfits You can pick an armor/outfit of your mod and make OpenBRF build the feminine version of it (it will be added as another frame of that mesh, just like the game wants).
Transfer of attribute between meshes You can copy one (or more) mesh(es), then paste their attributes into one or more target mesh(es) (see under [edit] menu). Attribute you can transfer include: per vertex color, UV mapping, vertex animation, rigging, etc.
Recoloring (i.e. per vertex colors support). Assign a uniform color, tune hue-saturation-brightness-contrast of existing colors.
Ambient occlusion Computes ambient occlusions and stores it as per vertex color. Adds a lot of realism cheap and fast to your meshes. Also works on meshes grouped together (depending on the current "view mode" settings). A few parameters (darkness, and light dispositions) can be tuned under "settings".
Transfer color from another mesh How-to: copy exemplar mesh(-es), select target mesh(-es), [edit]=>[paste vertex colors].
Transfer color from texture gets the color from a texture and saves it as per-vertex colors.
Multiply colors (!keep Shift pressed when applying any of the above four vertex color handling options, and the current mesh colors will be multiplied, instead of substituted, with the new ones!)
Tune hue saturation brightness Of vertex colors.

Tools for Collision Objects

Smart Import/exports of subparts To make collision objects using the efficient "sphere" and "capsules" primitive. See more info [here] http://forums.taleworlds.com/index.php/topic,72279.msg1912260.html#msg1912260 integrate below and reference.
Auto-quadrangolized To turn a triangle-based collision object to a more efficient quad-dominant one (because, in-game, it is better to use fewer quads than more triangles).
Smart visualization "X-rays" style. Also, real meshes can be visualized together with the collision mesh, to see how much it matches (it must reside in the same BRF file, and be called the same name, at most with a "bo_" added at the beginning).
Scale/translate/rotate/mirror/merge Of collision objects.
Build from mesh Turn a mesh (or a group of meshes) into a collision object (note: it better be closed, and appropriately low res).

Tools for Materials/Textures

Direct flag editing Of material, textures. Meaning of each flag reported.
Editing of multiple materials/meshes Just make a multiple selection and edit flags, texture names, etc.
Texture data OpenBRF will tell you everything about resolution, mipmap level, compression mode, disk size, location (module or common folder) etc. of your textures. You can open them in explorer by the press of a button.
Mini-"can't find texture" diagnostics If openBRF is not able to show textures, for whatever reason, it shows a checkboard replacement and offer a mini-diagnostic under settings.
Material rendering OpenBRF will try to guess rendering of a material (shininess, transparency, cutouts...) when rendering a material over a mesh. Normalmap and specular maps too.

Tools for Vertex Animations

Frame stacking Vertex animations are build stacking each frame separately. You can import them separately, or use the cut-frame, copy-frame, paste-frame operations (under "edit"). Either way, you can choose one of two algorithms in order to actually assemble the animation (make your choice under "settings" menu): either you trust the vertex order of your mesh, or you distinguish vertices by their vertex coordinates. More info at the section Vertex Animations.
Direct import/export As MD2 files.
Copy timings To transfer per-frame timings from an animation to another (select first animation, copy it (ctrl+C), select second animation, "edit" => "paste timings".
Split/merge frames Separate the vertex animation in separate meshes - one per frame, and recombine them into a vertex animation (possibly after editing them, or changing their order).
Construct from rigged A rigged mesh, or a skinned animation, can be converted into the equivalent vertex animation.
"Quiver" mode A mode to help making animations where the first frame is the most complete object (e.g. quiver and all arrows), and subsequent frames remove sub-parts by shringking them to a point (e.g. a quiver with fewer or no arrows). Start with most complete object, every staked frame will produce a copy of first frame with any missing polygon shrunk to a point. Activate under [settings]=>[on assemble vertex animations].

Module Management

Fast module.ini loading To make a quick auto-scan of the entire dataset as described in the module.ini-file (i.e. read all the included brf files for further references).
Module navigation To jump from a mesh to its material and from a material to its textures/shader (and back). Use Ctrl-arrows (left/right), or click on labels (e.g. "Material") in the panel. A link is provided go back from where you came.
"Used-by" submenu (the opposite of the above): You can see all other objects using an object (and load them if you want). The same menu shows all txt files making any use of that object, directly or indirectly (txt files are the one the games loads when it loads your module).
Autocompletion Of texture names, etc. Also, after you copy an object (Ctrl+C), you can paste its name (Ctrl+V) in a text box (you can still paste the object itself in the object list, to move it from a brf file to another).
Verify-module tool To scan the entire module for errors and inconsistencies: missing texture, doubled item, meshes using unknown material, wrong brf order in ini file. It's in the "module" menu.
Search To look for objects with a certain string in the name.
Scanning of txt So that OpenBRF knows what Meshes, Materials, Skeletons, etc. your module is using. Objects are color coded accordingly. More info [here] https://forums.taleworlds.com/index.php?threads/download-link-and-main-info-latest-ver-0-0-82e-19-jun-2016.72279/page-49#post-3323180 work in and reference
"Follow used" To jump from a mesh to its material and from a material to its textures/shader (and back). Use Ctrl-arrows (left/right), or click on labels (e.g. "Material") in the panel.
Show unreferenced DDS tool To see what texture files (DDS and TIFs) are sitting on the hard drive unused, and, optionally, confine them in a "unused" folder.
Dump module content from prompt if you run it from the command line (or a batch file) like this:
												
													OpenBRF.exe --dump <module_path> <file.txt>
												
											
then OpenBRF will not open the GUI, but instead it will dump an easy-to-parse text file with the names of all the meshes, materials, animations, etc. found in the BRF files which are listed in the module.ini of the module. This is intended to be used by other mod tools, e.g. to add auto-completion or error checking.

Meshes

In Mount&Blade, a mesh is composed of

  • an array (a set, a group, a bunch) of triangles [first number]
  • an array of vertices [second number]
  • an array of XYZ positions [third number]

But, wait, aren't the last two the same thing? No. A vertex has normals and uv text coordinates, but no XYZ coordinates. Instead, it has an index to a position, and the position has XYZ coordinates. Why so? That way two "vertices" which are in the same position but have different texture coords or normals (this is called a seam), can point at the same "position", and the actual XYZ coordinates are not repeated for the second vertex. So the mapping between vertices and positions is not 1:1 and there can be more vertices than positions. To make a first summary:

  • a face has only three indices, to three different vertices
  • a vertex has uv texture coordinates, normals and an index to a position
  • a position has XYZ coordintes, and rigigng (weitght and bone indices, for up to 4 bones)

However, mesh formats (e.g. obj) are not like that. They have only faces and vertices. Each vertex has X,Y,Z coordinates inside it, directly. So, two vertices in a seam (i.e. same position, different uv coords) repeat their coordiantes, each has its own copy of XYZ. This is commonly called an indexed mesh. SMD files has even less, they have only triangles: normals, uv coordinates, rigging etc. is repeated three times for the three vertices of each face. Therefore, after loading, there is the opportunity to save space/resources by merging together positions that are identical but that were separated in the original (obj), and even vertices (in SMD files).[12]

In Mount&Blade all meshes are triangles only (no quads, pentas, etc). If you import a mesh with quads, OpenBrf will have to make up triangles. Nothing sophisticated, it just split polygons into triangles without any smart strategy. So it could be that your mesh initially has quads, and when you import it they become triangles in a way you don't like. If so, make your mesh triangle-only in your application, before exporting it to an obj and importing it in OpenBRF.[13]

Another possible problem: in Mount&Blade all meshes have to be coherently oriented because back face culling is always used. This means that if you export a mesh with a triangle facing the wrong direction (wrong ordering of the three vertices inside the triangle), that triangle will disappear in-game and in OpenBRF (or, rather, will be visible only when seen from the "wrong" direction). If that's your problem, you need to make sure, in your application, that face orientation is correct before exporting.[13]

You might wonder about how many faces or vertices the Mount&Blade game engine can handle, so basically about how high quality your mesh can be before the game dies? There is a hard limit of 65535 (2^16-1) vertices per mesh.[14] This does however not mean that anything below is fine: The more often a mesh is showing up in-game, the better it should be optimized. A good first orientation is given by this list of triangles/faces:[15]

Normal helmet ~500 Sword ~250 Lance ~150/250 Interior scene ~1000
Full faced helmet ~800/1000 Special/Detailed sword ~400 Spear ~200/300 Detailed scenery <2000
Body armor ~1000 Small axe ~300 Shield ~400/500 Medium scenery ~700/800
Two-handed axe ~400 Bow ~100/200 Small scenery ~250
Two-bladed axe ~500 Crossbow ~300/400 Tiny scenery ~100/200

Mind, that the impact of the count of triangles/faces/vertices on the game engine does not scale linearly either: If vertices/faces aren't the bottleneck, it will make no difference at all on most computers until you start to add tens of thousands; if vertices/faces are the bottleneck, the number of them on rigged meshes will be way more impactful than on static meshes like weapons.[16] For more informations about performance optimization, see the respective section below.

As a last point before the subsections start you might want to know that it is easy to recenter a mesh in OpenBRF: Just use the "roto-translate-rescale" tool. To set the correct translation, just use the icons on the right: E.g. if you want to center the pivot point horizontally, use the "center" icon on X and Z (they look like this: [|] ); if you want the mesh to just touch the ground, then use the "minimum" icon on Y (it looks like this: |[ ] ). You can retouch these choices by pushing the object a bit left/right (X), up/down (Y), near/far (Z), using the arrow or entering values.
Be aware that the center/minimum/maximum are computed with respect to all selected objects. So for example if you have a combined object, select all its part before you "roto-translate-rescale" them. Too see where the pivot point is, make sure floor is activated (in mod panel) and look for that little gray dot in the center of the grid.[17]

Multi-meshing

When looking through the brf files of various mods you might have discovered the possibility to let a mesh consist out of multiple meshes. One of these might look like as in the screenshot below or the following:

								
									mesh_name
mesh_name.1
mesh_name.2

This is the so called multi-meshing, with mesh_name being the base mesh and the others the so called submeshes. Multi-meshes work because the game engine thinks of a list of meshes with a .# suffix as a single unit and will combine those meshes on its own. You might be asking yourself why you shouldn't simply combine those meshes into one. That is because every mesh is limited to one material (and thus one texture set).[18] However, at some weapons or especially scene props it can sometimes be necessary to use different materials on multiple parts of the same mesh, resulting in multi-meshing it.

With the latest version of Warband you can pretty much multi-mesh everything, from items to scene props.[18] At versions earlier than 1.134, so Vanilla M&B of course as well, multi-meshing is only possible for scene props and flora, not for items. Latter one will display only the first mesh from the list.[19] You will still face this old restriction in a similar way at another related field: multi-meshed items will be automatically combined when displayed as weapon icons, using the first mesh's material definition,[20] and the inventory view only displays the primary mesh.[21] It is therefore still worth to think about combining item meshes by creating texture atlases, re-uvmapping the mesh such way that all parts are using the same material.

Another drawback is that every multi-mesh will need to load and apply multiple materials, textures and/or shaders which will affect the performance.[21] It is assumed that the engine has to render every texture even if they are hidden behind something. This gets worse the closer the player gets, meaning more pixels in the screen-space have to render the expensive shaders that come with armour for example. You might have experienced this when looking at large amounts of agents melee that the fps changes a lot depening on if you watch them in melee or are looking away of them. Reducing the number of multi-meshed items has been found to be good for performance, any more than three or four meshes on an item can start to kill fps due to draw calls.[22]

The M&B game engine morphs helmets to fit to the head which is sometimes resulting in a not desired deformation. Multi-meshing the helmet with an empty mesh as the base mesh is one way to prevent this from happening. Alternatively one can remove (if given) the item property flag itp_fits_to_head at the respective item entry.

Take note that multi-meshing is not possible for map icons. You need to work around this by using two map icons.[23]

Be aware of that multi-meshing rigged meshes has a heavier impact on the game engine than multi-meshing static meshes. You are paying a lot of the computational costs of two models where you would normally be paying one. For example, the model consists then out of multiple tristrips. Each tristrip will need to get transformed as a separate operation; it won't cost nearly as much the second time (matrix calculations won't need to be done again) but it's still a bit more expensive. Then there's the additional overhead, if you use multiple materials (about the only reason to use multimesh, imo). Another texture call and depending on how the engine batches rendering operations, it may be having to render that portion of the model from start again, bones and all (One can doubt it, but multi-mesh support for rigged meshes was added very late at the development of the Mount&Blade game engine, and largely at modder request, so it is not known how much work was put into making it efficient, clear answers about how the engine does batching are also missing).[24]

LODs, Level of Details

Models should become less detailed on distance, this will save a lot of GPU strain for your game, especially in big maps, with lots of players. LoDs are compressed or lewer-resolution versions of a mesh which are normally displayed at a distance at which you can't tell much difference. The game enginge is thus saving performance and loads the high-resolution version when the player is close enough. In general you have the base mesh and four LoDs as follows:

								
									mesh_name (base)
mesh_name.lod1
mesh_name.lod2
mesh_name.lod3
mesh_name.lod4

The in-game range at which LoDs trigger is affected by the slider bar "Character Details" at the Video Options. The exact formula is as follows:[25]

								
									lodValue = 1.0 / max(objectDistanceToCameraSquared, 1.0) * ((screenWidth + screenHeight) * 0.5 / 1150.0) * (characterDetailGameOption * 0.5 + 0.75) * (75.0 / currentFieldOfView)

lod0: lodValue >= 0.01
lod1: 0.01 > lodValue >= 0.0025
lod2: 0.0025 > lodValue >= 0.000625
lod3: 0.000625 > lodValue >= 0.00015625
lod4: 0.00015625 > lodValue

Meshes can exist without any LoDs at all. Most of the time it's optimal to have only 2 LoDs - lod2 and lod4 - to save disk space and loading times, as well as making pop-in less apparent.[26] Creating all LoDs (1,2,3,4) will be unnecessary memory usage. There is almost no difference between lod1 and lod0, the base. It is just too close, any larger change in geometry will be immediately visible. Creating a very low quality lod4 will do fine for most clothing items. Do not take the "lod2-lod4-only-rule" too serious though. In some cases it will be better to use lod3 instead of lod2. At all LoDs, make sure that they use the same material as its parent.[27] What matters more for quality is good color transition, so that your lods do not change color/lighting when going from one to the other.[28]

If the base mesh of a multi-meshed item has LoDs then the submeshes will often have them too. Multi-meshing is possible for LoDs too, given you apply a name convention as follows:[29]

								
									mesh_name
mesh_name.1
mesh_name.2
mesh_name.lod1
mesh_name.lod1.1
mesh_name.lod1.2
...

LoDs for scene props were introduced in Warband. Since buildings are static meshes and get handled very efficient by the game engine, LoDs shouldn't influence performance as much. In general buildings don't require LoDs unless they are complex models with high polycount that would crash low-end PCs. Simplify your models if that happens and especially don't let battles happen in complex, high-poly scenes.[30]

Rigging

The words "rigged" and "skinned" are often used like synonyms. For this little section this works out fine as it only contains remarkable notes regarding helmets. The topic rigging is not dealt with in depth as this is more a 3D-related topic out of scope of this guide.

Skinned and non-skinned helmets

There exist two types of helmets, skinned and non-skinned ones. The skinned ones are attached to the skeleton, so they appear relative to armor meshes in OpenBRF. They have the box "skinned" checked in the meshes window and you can play an animation at them. Their item entries need to have the item property flag itp_attach_armature for the mesh to show up correctly in-game, otherwise you will get a helmet floating in the air in front of the agents. The item entry will also need a second mesh together with ixmesh_inventory to show up correctly at the inventory screens. Non-skinned (most common) helmets are not attached to the skeleton, and they appear close to origin and horizontal in OpenBRF. That's why the "helmet" button exists in the bottom right corner of OpenBRF.[31]

Completely rigid helmet

If you are happy with the entire helm moving rigidly with the head, as opposed to having some part deforming according to the position of, say, the shoulders, then you want your helmet to be (a) "non-skinned" and (b) around the origin. Instead, your helmet is around the head region and maybe it is skinned to (to the head bone). Is your helmet already skinned? (look at the middle panel, it will tell you). If it is, skip to step 4. If not, first you need to temporary add skinning (gluing all the model to the head bone):[31]

  1. Select the helmet
  2. [Selected] => [mount on one bone...] opens a dialog...
  3. Select human skeleton, then head bone, and check "Piece currently centered: in the correct final position", and hit ok.
    Now, place the hemlet on the origin while removing the skinning:
  4. Select the helmet alone
  5. In the middle panel, pick any animation + human-skeleton (this is just to let openBRF know which skeleton to assume, that is, "human")
  6. [Selected] => [Discard] => [Rigging (unmount from bone)]
NON-completely rigid helmet

If you want your helm to deform, e.g. with the shoulder, then you need to have it skinned and positioned around the head. If it is already correctly positioned you just need to add the skinning (not all to the head bone: some part to the head, some part to the shoulders or spine, etc). A possible way to to this:[31]

  1. Select a skinned helm AND armour, or possibly multiple such things (multiple selection)
  2. Copy (ctrl+C)
  3. Select your helm (already in the final position, i.e. where the head is)
  4. [Edit] --> [Paste rigging]
  5. Test an animation and see how it looks!

Vertex Animations[32]

A vertex animation is just a sequence of meshes, one mesh per frame. Each frame is also associated to a timing. There is however a catch since each frame only redefines positions and normals.[33] Everything else gets shared by all frames and thus needs to be the same: triangles (which triangle connects which vertices), texture coords (coordinates),[34] rigging (in case the mesh is also rigged), per vertex colors, and so on. This also means that the frames are bound to have the same number of vertices and faces.

Note that the frames must be considered just keyframes. The game is "free" to interpolate between two frames of the vertex animation to get smoother animations. It will exploit that, for example when it animates bows.

Vertex animations are used for many things:

  • Animated map icons on the world map, in which case the first frame (the numbering at frames starts with 0, so the first frame is frame 0) is unused, the second is the stance pose, the rest is the walking sequence.
  • Weapons animations, like the bow and crossbow strings.
  • Armours, at which the first frame is unused, the second frame is the male and the third the female version. Take note of the time of frame 2, the female one. The necessary time here gets determined by the morph key of the skin entry. Look up the section Morph Key for more informations about skin flags and morph keys.
  • Quivers and the like, at which each frame represents a different number of arrows, bolts, etc. which are still left.
  • Shields, at which a frame is for when they are fastened around the body and the other one for when the belt is loose and the shield gets carried at the arm.
  • Scabbards, at which the first frame is with sheathed weapon and the second frame without it.
  • Hands or gloves, at which the first frame is an open glove, the second half-closed and the third closed in a fist or grab.
  • Customizable heads, at which frame 0 is the base head. Each frame is the effect of a "slider", like "eye-to-eye distance".
  • Scene props, see the section Vertex Animated Scene Props for more details.

... and maybe other things too.

You have two options for making your own vertex animations in OpenBrf. Since version 0.38 of the tool OpenBRF, you can import and export vertex animations as MD3 files, the format introduced by Quake3. Alternatively you stack them frame by frame. So, typically, you export a frame, edit it, reimport it and attach it to your animation.

You can do this in the cut-and-paste way: with Ctrl-Alt-X, Ctrl-Alt-C, Ctrl-Alt-V (as you can see in the edit menu) you perform cut and paste operations that refer to individual frames (and apply to the currently selected frame). So you can import a mesh and stack it to your animaton by cut and paste. You can also redefine the frame order, duplicate frames, etc.

Otherwise you can do it via direct frame import and attach: when your frame is in an external file, as a shortcut, you can also import a static mesh directly as an additional frame of the currently selected mesh (menu "import").

At all methods, remember to edit at the end of the process manually the times (in the "data" box) of each frame.

What makes the process messy (if you tried in other occasions, like in OpenBRF you know) is that when you assemble frames you are assuming that not only the vertex number, but even their internal order has been kept the same by all import and export operations. Otherwise, say vertex N.412 is on the head in frame 1, but on the foot in frame 2: then it kills everything! Textures, triangles, interpolations... result is a mess. That is because, as you might remember, triangles, texture coords, etc. are shared by all frames. So, if you have a triangle connecting vertex N.412, N.51 and N413 together, that applies to all frames.

In OpenBRF you have two options to merge a frames into an animation. You select which one of them below is your favourite option, 1 or 2, in the option menu ("Option" => "On assemble vertex animation").

  • Option 1: you pray that the vertex order is kept unmodified by your mesh import/exports (OpenBrf will comply, but who knows what, say, Blender or Wings3D will do). This is the "old way" and it works, sometimes.
  • Option 2: you resort to use texture coords as unique identifiers of vertices. You just assign to each vertex of your mesh an unique UV-point in texture space.[35] Once your texture coords identify the vertices in frame 1, don't touch them anymore. Feel free to edit the mesh 3D shape for all other frames!

Note that the system is somewhat robust: if option 1 fails (e.g. different number of vertices) it will fallback to option 2 automatically. If option 2 fails (e.g. same texture coords for different points), it will fallback to option 1 (for that vertex only).

When you select multiple meshes and [merge as frames in vertex ani], the order of the frames is determined by their ordering in the list, not by the order in which you selected them. This is done so because it was imagined that the former is easier to control than the latter (for the user of OpenBRF).[36]

As a side note, the first frame (frame [0,*]) of a vertex animation is never, ever used by the game (in animated map icons, hands, scabbards, quivers, armors, face-morphs... anything that uses a vertex animation). That frame is probably there only for "historical" reason and the game BRF-loader doesn't even "see" it. Naturally the fact that it is unused doesn't mean you can remove it: if you do, frame 1 becomes frame 0, thus becoming unused.[37]

Female frame

You probably know that Mount&Blade (and WarBand alike) keeps a different "vertex animation frame" for masculine and feminine versions of an armor. Now OpenBRF can build the feminine version from the masculine version. Don't expect miracles: if you build the feminine version by careful, artful, manual mesh editing, you will get better results. But it is not bad to be automatic. After you applied this option, to see how it went, switch to the feminine frame of the mesh (by changing the "frame" inside the "data" box in the center).[38]

Now, unfortunately Warband and M&B use different conventions: M&B uses the first frame as F and the second one as M, Warband does it the other way round. So OpenBRF tries to guess which version your module is for and acts accordingly to decide where to place the F armor frame it just built. If your mesh already has a feminine frame, it asks if you want to overwrite it. In the module, the new armour should just work, switching frame according to wearer's gender.[38]

The frame timings must be set right too which should be done by OpenBRF. Naturally, "timing" here has nothing to do with time... it is just the way which the game uses to pick which frame of the outfit must be used. See the section Skin Flag and Morph Key for more details. The timings of the frames can also be set manually:[39]

  • In Warband
    										
    											masculine frame (n.1) => timing = 0;    feminine frame (n.2) => timing = 10
    										
    									
  • In M&B
    										
    											feminine frame (n.1) => timing = 10;    masculine frame (n.2) => timing = 20
    										
    									

recognize custom feminizer morpher, mtarini, FAQ and Troubleshooting

Scabbards

vertex animating sword scabbard, SupaNinjaMan, Modding Q&A

sword scabbards, quote should already be present somewhere above, Modding Q&A

sword scabbards, Swyter, Download link and main info!

moving rotating scabbard mesh, Ivkolya, Modding Q&A

Quivers

quiver mode, Computica and mtarini, Download link and main info!

vertex animation, mtarini, Vertex Animation

Gloves and Gauntlets

Gloves are not rigged but vertex-animated, they don't have enough bones to relate to to make rigging useful.[31] GetAssista, Modding Q&A

old gauntlets (in item_meshes1.brf) have 3 frames, and the first one is used to display it in shops, the second is unused, and the third will actually be displayed on the agent. No real use for them unless you want them to look differently in the inventory, in which case you can just use another mesh with ixmesh_inventory instead., Somebody, Modding Q&A

gauntlet stuff, rgcotl (credit), Modding Q&A

gloves have sometimes this special stuff with not only _R (needed for unrigged gloves) but also expansions with _Rx, dstn, Mount & Blade Modding Discord

gloves rx lx, Somebody, [WB] Warband Script Enhancer v3.2.0

Vertex Colouring

Color uniform option at OpenBRF, Somebody, Modding Q&A

get vertex colours into openbrf, Vornne, Modding Q&A

Others

hard-coded default bullet flying mesh, ithilienranger and SonKidd, Modding Q&A

Reskeletonize meshes. Add reference to "Skin Flag and Morph Key" chapter.

tangent direction saving, mtarini, tangent dir will not save

Tangent direction infobits, mtarini, Download link and main info!

boots, mtarini, Download link and main info!

Collision Meshes

Multi-meshing is not possible for collision-meshes, GetAssista, Modding Q&A

BRF Format and collision meshes, fisheye, BRF Format and collision meshes: brief documentation (Pt 1)}.

How to build good collision objects, mtarini, Download link and main info!

quads instead of tris where appropriate, mtarini, Download link and main info!

collision mesh info bits, various participants, Download link and main info!

Materials

Explanation difference material and texture, Vincenzo (credit?), What is material as opposed to texture?

material of lods, xenoargh, What is material as opposed to texture?

prevent sun from going through flora, _Sebastian_, Modding Q&A

don't block light at materials? Sun shining through sceneprop (interesting side bug with golden shining river), Ruthven and jacobhinds, Modding Q&A

semi-transparent meshes (brf bug?), _Sebastian_, Modding Q&A

render order, Lumos, Modding Q&A

rgb and coef tuning, xenoargh, RGB + Coef Tuning

spec map settings, mtarini, Spec Map settings vs. Ingame

Environment mapping, mtarini, Question regarding graphics and shaders

Refreshing texture and material, Vornne, Texture Refresh

Textures

Average texture limit, xenoargh, Modding Q&A

Specular map, jacobhinds, Modding Q&A

Square texture size, jacobhinds, Modding Q&A

Mipmaps, _Sebastian_, Modding Q&A

.lod textures, jacobhinds, Modding Q&A

alpha performance, Somebody, Modding Q&A

low-res option uses mip-maps, FantasyWarrior (credit), Modding Q&A

alpha stuff at textures, SupaNinjaMan, Modding Q&A

Older version gave error message at wrong size of texture, Chilly5, BaldwinIV and fisheye (credit), dds error: size=not a power of 2

Interesting, texture size etc., mtarini, Shader and Graphical effects Discussion

textures not found (white-blue checkerboard patter), mtarini, FAQ: textures not found (white-blue checkerboard patter): how to fix?

The colour 8080FF is the base colour for normal maps and makes them flat, jacobhinds, Mount & Blade Modding Discord

Colours of normal maps, mtarini, Problemos with dem normal maps

waterbump and second diffuse texture, mtarini, Question regarding graphics and shaders

texture doesn't show up, mtarini, dds texture won't function in OpenBRF

texture atlas, mtarini, Organising textures into atlases

Shaders

Shaders, mtarini, Shader and Graphical effects Discussion

Some shaders don't support vertex animation for quivers, GetAssista, Modding Q&A

Adding shaders, perhaps outdated, Abhuva and Vornne, Modding Q&A

Some shader notes, SonKidd, Modding Q&A, and mtarini, Green Normalmaps.. Question??

Interesting stuff with animated textures, perhaps dstn will test it, Thorgrim, New version texture errors

water reflections, Vornne, Modding Q&A

Skinned shaders, jacobhinds, Modding Q&A

billboard shaders (need to ask dstn about optimality), jacobhinds and MadocComadrin, Modding Q&A and Modding Q&A

shaders stuff, jacobhinds, Modding Q&A

engine picks random texture for shader if not provided, _Sebastian_, Modding Q&A

green and pink spots at terrain (some problem dstn tried to figure out, shader related?), Swyter, old forum link, Shader Stuff- HLSL instruction limits

beard problem with shader (not happening with Native ones), Garedyr (credit), Modding Q&A

Seems like using non-Native shaders inside of a skin's .LOD material causes crashes when the LOD material is used, dstn, Mount & Blade MOdding Discord

shader stuff, Swyter, [WB] Warband Script Enhancer v3.2.0

Add custom preview shaders, mtarini, Suggestions/requests thread -- post yours here

Animations

T frame at new animation, NPC99, Modding Q&A

Editing animations, mtarini, Editing animations

Some info, mtarini, Download link and main info!

Some more info, mtarini, Download link and main info!

Skeletons

hitboxes for skeletons, La Grandmaster, Modding Q&A

Resize skeleton via openbrf, mtarini, Xenoargh's "Aleph" project

About skeleton editing, mtarini, Download link and main info!

Performance Optimization

Perhaps integration at other sections, will see how it goes.

Optimize performance of a mod, Abhuva, Modding Q&A

performance question here is a loading time question, Somebody and cmpxchg8b, Modding Q&A

Mod optimization, Caba`drin, Modding Q&A

Loading stuff, Caba`drin, Modding Q&A

Loading overhead 10 items vs one new texture, Somebody, Modding Q&A

rearranging brf files for optimization, kraggrim, Modding Q&A

resource management, kraggrim, Modding Q&A

brf organisation, _Sebastian_, Modding Q&A

philosophy and optimisation, kalarhan, Modding Q&A

optimisation, _Sebastian_, Modding Q&A

common errors at brf resource management, Ramaraunt (credit), Modding Q&A

Texture atlas of 4k recommended and some more optimisation stuff, Marko, Leonion and NPC99, Modding Q&A, Modding Q&A and Modding Q&A

Optimization talk, various participants, Vertex Cache Optimization?

Scanning module for usage, mtarini, Download link and main info!

BRF sizes, jacobhinds, BRF sizes

Remaining Notes

OpenBRF faq and troubleshouting, mtarini, FAQ and Troubleshooting

Some map icon/heraldic informative stuff, dunde, Modding Q&A

some useful brf info (normal map -> tangent blubb), also follow up posts, NPC99, Modding Q&A and Modding Q&A

realistic shadow on plants, Ruthven, Modding Q&A

morph not working for boots, cmpxchg8b, Modding Q&A

import static meshes, Swyter, Modding Q&A

OpenBRF copy complete (mesh+material+textures), Swyter, Modding Q&A

Don't forget to integrate Maroon's tutorial

tangent directions, mtarini, Recompute Tangent Dirs

clarification vertex animation, rigged mesh and skeleton, mtarini, import SMD as animation frame?

flag meanings at materials, texture, meshes, shaders, various participants, Flag Meanings (in materials, shaders, textures, meshes...)

double clicking on meshes, mtarini, no double click grouping

Ambient Occlusion, mtarini, Suggestions/requests thread -- post yours here

Mirroring faces, Swyter, Suggestions/requests thread -- post yours here, although I recall that kraggrim mentioned that it doesn't work (anymore).

Ragdoll parameters and hitboxes, mtarini, Download link and main info!

Mixed informations, mtarini, Download link and main info!

Alpha cutouts, mtarini, Download link and main info!

Ambient occlusion, mtarini, Download link and main info!

Again about ambient occlusion, should already be a footnote (38!), mtarini, Download link and main info!

More ambient occlusion, mtarini, Download link and main info!

Various info bits, mtarini, Download link and main info!

collision flags, cmpxchg8b, Download link and main info!

play animation switches to last frame, Maroon, Download link and main info!